package com.reactim.message.config.validation;

import jakarta.validation.Constraint;
import jakarta.validation.Payload;
import java.lang.annotation.*;

/**
 * Redis键前缀验证注解
 * 验证Redis键前缀格式是否正确
 */
@Target({ElementType.FIELD, ElementType.PARAMETER})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = RedisKeyPrefixValidator.class)
@Documented
public @interface ValidRedisKeyPrefix {
    
    String message() default "Redis键前缀格式不正确";
    
    Class<?>[] groups() default {};
    
    Class<? extends Payload>[] payload() default {};
    
    /**
     * 是否必须以冒号结尾
     */
    boolean requireColonSuffix() default true;
    
    /**
     * 最小长度
     */
    int minLength() default 3;
    
    /**
     * 最大长度
     */
    int maxLength() default 100;
}